package com.ysh.smartplatform.mapper;

import com.ysh.smartplatform.pojo.SysArea;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 袁胜虎 on 2022/9/17 15:42
 */
public interface AreaMapper {

    @Insert("insert into sys_area (area_id,area_name,parent_id,level) values (#{areaId},#{areaName},#{parentId},#{level})")
    void interArea(SysArea area);

    @Select("select * from sys_area")
    List<SysArea> findAllArea();

    @Update("update sys_area set area_name = #{areaName},parent_id = #{parentId},level = #{level} where area_id=#{areaId}")
    void updateArea(SysArea area);

    @Delete("delete from sys_area where area_name = #{areaName}")
    void deleteByName(String name);
}
